package com.yangjun.dao.mybatis.mapper.businessAnalysis;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.yangjun.entity.businessAnalysis.DmUserAllAnalysis;

public interface MemberAnalysisMapper {

    //查询不同平台的购买会员数
    public List<Map<String,Object>> queryAllMemberByPlatform();
    //根据特定渠道查询购买会员数
    public int queryMemberByOrderSource(@Param(value="ordersource") int ordersource);
    //查询平台新增购买会员
    public List<Map<String,Object>> queryPlatFormIncreasedMember();
    //查询科室新增购买会员
    public List<Map<String,Object>> queryOfficesIncreasedMember(@Param(value="ordersource") String ordersource);
    //查询全司历史新增购买会员数
    public List<Map<String,Object>> queryAllIncreasedMember(@Param(value="ordersource") String ordersource,@Param(value="typename") String typename);
    //查询全司历史复购会员数
    public List<Map<String,Object>> queryAllRePurchaseMember(@Param(value="ordersource") String ordersource,@Param(value="typename") String typename);
    //查询全科室历史购买会员数
    public List<Map<String,Object>> queryOfficesMember(@Param(value="ordersource") String ordersource);

    //查询新增会员数，每个月
    public List<Map<String,Object>> queryAllIncreasedMemberByMonth(@Param(value="ordersource") String ordersource,@Param(value="typename") String typename);
    //查询最近两年每个月新增的会员数
    public List<Map<String,Object>> queryRecentTwoYearIncreasedMemberByMonth(@Param(value="yearArr") String[] yearArr,@Param(value="lastTwoYear") String lastTwoYear,@Param(value="ordersource") String ordersource,@Param(value="typename") String typename);
    //查询最近两年每个月复购的会员数
    public List<Map<String,Object>> queryRecentTwoYearRePurchaseMemberByMonth(@Param(value="yearArr") String[] yearArr,@Param(value="ordersource") String ordersource,@Param(value="typename") String typename);

    //查询全司不同复购次数的会员数
    public Map<String,Object> queryRePurchaseByTimes(@Param(value="ordersource") String ordersource,@Param(value="typename") String typename);
    //查询全司复购不同金额的会员数
    public Map<String,Object> queryRePurchaseByMoney(@Param(value="ordersource") String ordersource,@Param(value="typename") String typename);
    //查询全司复购根据次数时间范围查询,近一年
    public List<Map<String,Object>> queryRePurchaseByTimesAndDate(@Param(value="dataDate") String dataDate,@Param(value="currentMon") String currentMon,@Param(value="ordersource") String ordersource,@Param(value="typename") String typename);
    //查询全司复购根据金额范围查询,近一年
    public List<Map<String,Object>> queryRePurchaseByMoneyAndDate(@Param(value="dataDate") String dataDate,@Param(value="currentMon") String currentMon,@Param(value="ordersource") String ordersource,@Param(value="typename") String typename);
    //查询全司订单数根据订单间隔查询,近一年
    public List<Map<String,Object>> queryOrdersByOrderInterval(@Param(value="dataDate") String dataDate,@Param(value="currentMon") String currentMon,@Param(value="ordersource") String ordersource,@Param(value="typename") String typename);
    //查询全司订单数根据订单间隔查询。历史
    public Map<String,Object> queryHistoryOrdersByOrderInterval(@Param(value="ordersource") String ordersource,@Param(value="typename") String typename);
    //全司最后购买分析
    public Map<String,Object> queryLastPurchaseMembersByOrderInterval(@Param(value="ordersource") String ordersource,@Param(value="typename") String typename);
    //全司最后购买分析,最近一年每月快照
    public List<Map<String,Object>> queryLastPurchaseSnapshot(@Param(value="dataDate") String dataDate,@Param(value="currentMon") String currentMon,@Param(value="ordersource") String ordersource,@Param(value="typename") String typename);

}
